<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{$goods.goods_name}-{$tpshop_config['shop_info_store_name']}</title>
    <meta name="keywords" content="{$goods.keywords}"/>
    <meta name="description" content="{$goods.goods_remark}"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/tpshop.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/jquery.jqzoom.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/layer/layui.css">
    <script src="__STATIC__/js/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="__STATIC__/js/move.js" type="text/javascript" charset="utf-8"></script>
    <script src="__PUBLIC__/js/layer/layer-min.js"></script>
    <script src="__PUBLIC__/layer/layui.js"></script>
    <script type="text/javascript" src="__STATIC__/js/jquery.jqzoom.js"></script>
    <script src="__PUBLIC__/js/global.js"></script>
    <script src="__PUBLIC__/js/pc_common.js"></script>
    <link rel="stylesheet" href="__STATIC__/css/location.css" type="text/css"><!-- 收货地址，物流运费 -->
    <link rel="shortcut icon" type="image/x-icon"
          href="{$tpshop_config.shop_info_store_ico|default='/public/static/images/logo/storeico_default.png'}"
          media="screen"/>
</head>
<body>
<!--header-s-->
<include file="public/header" w="w1224"/>
<!--header-e-->
<div class="search-box p">
    <div class="w1224">
        <div class="search-path fl">
            <foreach name="navigate_goods" key="k" item="v">
                <a href="{:U('/Home/sale/goodsList',array('id'=>$k))}">{$v}</a>
                <i class="litt-xyb"></i>
            </foreach>
            <div class="havedox">
                <span>{$goods.sname}</span>
            </div>
        </div>
		<!--
        <div class="online-service fr p">
        	<a href="javascript:void(0);" class="z-onlines z-online-service fr"><i></i>在线客服</a>
        </div>
		-->
    </div>
</div>
<div class="details-bigimg p">
    <div class="w1224">
        <div class="detail-img">
            <div class="product-gallery">
                <div class="product-photo" id="photoBody">
                    <div class="product-video">
                        <if condition="$goods.video">
                            <video id="video" src="{$goods.video}" controls="controls" preload="preload"
                                   onended="this.load();">
                                您的浏览器不支持查看此视频，请升级浏览器到最新版本
                            </video>
                        </if>
                    </div>
                    <i class="close-video"></i>
                    <i class="video-play"></i>
                    <!-- 商品大图介绍 start [[-->
                    <div class="product-img jqzoom">
                        <img id="zoomimg" src="{$goods.id|sale_thum_images=400,400}"
                             jqimg="{$goods.id|sale_thum_images=800,800}">
                           <!--   <img id="zoomimg" src="{$goods.original_img}"
                             jqimg="{$goods.original_img}"> -->
                    </div>
                    <!-- 商品大图介绍 end ]]-->
                    <!-- 商品小图介绍 start [[-->
                    <div class="product-small-img fn-clear">
                        <a href="javascript:;" class="next-left next-btn fl disabled"><</a>
                        <div class="pic-hide-box fl">
                            <ul class="small-pic" id="small-pic" style="left:0;">
                                <volist name="goods_images_list" id="img">
                                    <li class="small-pic-li <if condition='$i eq 0'>active</if>">
                                    <a href="javascript:;"><img src="{$img|get_sub_images_sale=$img[goods_id],60,60}"
                                                                data-img="{$img|get_sub_images_sale=$img[goods_id],400,400}"
                                                                data-big="{$img|get_sub_images_sale=$img[goods_id],800,800}">
                                        <i></i></a>
                                    </li>
                                </volist>
                            </ul>
                        </div>
                        <a href="javascript:;" class="next-right next-btn fl">></a></div>
                    <!-- 商品小图介绍 end ]]-->
                </div>
                <!-- 收藏商品 start [[-->
                <div class="collect">
                    <a href="javascript:void(0);" id="collectLink"><i class="collect-ico collect-ico-null"></i>
                        <span class="collect-text">收藏商品</span>
                        <em class="J_FavCount">({$goods['collect_sum']+$goods['virtual_collect_sum']})</em>
                    </a>
                    <!--<a href="javascript:void(0);" id="collectLink"><i class="collect-ico collect-ico-ok"></i>已收藏<em class="J_FavCount">(20)</em></a>-->
                </div>
                <!-- 分享商品 -->
                <div class="share">
                    <div class="jiathis_style">
                        <div class="bdsharebuttonbox">
                            <a href="#" class="bds_more" data-cmd="more"></a>
                            <a href="#" class="bds_qzone" data-cmd="qzone"></a>
                            <a href="#" class="bds_tsina" data-cmd="tsina"></a>
                            <a href="#" class="bds_tqq" data-cmd="tqq"></a>
                            <a href="#" class="bds_renren" data-cmd="renren"></a>
                            <a href="#" class="bds_weixin" data-cmd="weixin"></a>
                        </div>
                    </div>
                    <script>
                        var bd_url = "http://{$_SERVER[HTTP_HOST]}/index.php?m=Home&c=sale&a=goodsInfo&id={$_GET[id]}";
                        var bd_pic = "http://{$_SERVER[HTTP_HOST]}{$goods[id]|sale_thum_images=400,400}";
                        var bdText = "{$goods.sname}";
                        var user_id = getCookie('user_id');
                        // 如果已经登录了, 并且是分销商
                        if (parseInt(user_id) > 0) {
                            bd_url = bd_url + "&first_leader=" + user_id;
                        }

                        function setShareConfig(id, config) {
                            config.bdUrl = bd_url;
                            config.bdPic = bd_pic;
                            config.bdText = bdText;
                            return config;
                        }

                        window._bd_share_config = {
                            "common": {
                                onBeforeClick: setShareConfig,
                                "bdSnsKey": {},
                                "bdText": "",
                                "bdMini": "2",
                                "bdPic": "",
                                "bdStyle": "0",
                                "bdSize": "16"
                            },
                            "share": {},
                            "image": {
                                "viewList": ["qzone", "tsina", "tqq", "renren", "weixin"],
                                "viewText": "分享到：",
                                "viewSize": "16"
                            },
                            "selectShare": {
                                "bdContainerClass": null,
                                "bdSelectMiniList": ["qzone", "tsina", "tqq", "renren", "weixin"]
                            }
                        };
                        with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];
                    </script>
                </div>
            </div>
        </div>
        <form id="buy_goods_form" name="buy_goods_form" method="post" action="">
            <input type="hidden" value="{$goods.id}" id="goods_id"><!-- 商品id -->
            <input type="hidden" name="starttime" value="{$goods.starttime}" id="starttime"/><!-- 活动开始时间 -->
            <input type="hidden" name="endtime" value="{$goods.endtime}"/><!-- 活动结束时间 -->
            <input type="hidden" value="{:session('user.user_id')}" id="uid">
            <input type="hidden" value="{$cash.state}" id="states">
            <div class="detail-ggsl">
                <h1>{$goods.sname}</h1>
                <div class="presale-time"  style="display: none">
                    <div class="pre-icon fl">
                        <span class="ys"><i class="detai-ico"></i><span id="activity_type">拍卖</span></span>
                    </div>
                    <div class="pre-icon fr">
                        <span class="per"><i class="detai-ico"></i><em id="order_user_num">{$goods['count']}</em>人拍卖</span>
                        <span class="ti" id="activity_time"><i class="detai-ico"></i>剩余时间：<span
                                id="overTime"></span></span>
                        <span class="ti" id="prom_detail"></span>
                    </div>
                </div>
                <div class="shop-price-cou p">
                    <div class="shop-price-le">
                        <ul>
                            <li class="jaj"><span id="goods_price_title">起拍价：</span></li>
                            <li>
                                <span class="bigpri_jj">&nbsp;<em>￥</em>&nbsp;&nbsp;<span id="goods_price">{$goods.shop_price}</span>
                                </span>
                            </li>
                        </ul>
                        <ul>
                            <li class="jaj"><span id="goods_price_title">当前价：</span></li>
                            <li>
                                <span class="bigpri_jj" id="now_prices">&nbsp;<span id="uname" style="color: #666;"><span>{$goods.uname} : </span>&nbsp;</span><em>￥</em>&nbsp;&nbsp;<span id="now_price">{$goods.now_price}</span>
                                </span>
                            </li>
                        </ul>
                        <ul>
                            <li class="jaj"><span id="market_price_title">保证金：</span></li>
                            <li>
                                <span class="bigpri_jj">&nbsp;<em>￥</em>&nbsp;&nbsp;<span id="market_price">{$goods.market_price}</span>
                                </span>
                            </li>
                        </ul>
                        <ul>
                            <li style="color:#666;font-size:12px;letter-spacing: 2px;"><span>起拍价梯度 ： </span></li>
                            <span class="bigpri_jj"><em>￥</em>&nbsp;&nbsp;<span id="add_price">{$goods.add_price}</span>
                                </span>
                           <!--  <li><span class="bigpri_jj" id="add_price"><em>￥</em>{$goods.add_price}</span></li> -->
                        </ul>
                      <!--   <ul>
                            <li class="jaj ls4"><span>联系方式 ： </span></li>
                            <li class="mobile-buy-cheap"><span>用户：{$goods.user}</span></li>
                            <li><spa  class="mobile-buy-cheap">号码：{$goods.phone}</span></li>
                        </ul>
                        <ul>
                            <li class="jaj ls4"><span>起拍时间 ： </span></li>
                            <li><span class="fullminus">{$goods.starttime|date='Y-m-d H:i:s',###}</span></li>
                        </ul> -->
                    </div>
                    <div class="shop-cou-ri">
                        <div class="allcomm"><p>拍卖人数</p>
                            <p class="f_blue">{$goods['count']}</p></div>
                       <!--  <div class="br1"></div>
                        <div class="allcomm"><p>累计销量</p>
                            <p class="f_blue">{$goods['sales_sum']+$goods['virtual_sales_sum']}</p></div> -->
                    </div>
                </div>
<!--                 <div class="standard p">
                    <ul>
                        <li class="jaj ls4"><span>联系方式：</span></li>
                        <li class="mobile-buy-cheap"><span>用户：{$goods.user}</span>&nbsp;&nbsp;&nbsp;<span>号码：{$goods.phone}</span></li>
                    </ul>
                </div> -->
                <div class="standard p">
                    <ul>
                        <li class="jaj ls4"><span>起拍时间 ： </span></li>
                        <li><span style="color: #e23435">{$_SESSION['user']['user_id']}{$goods.starttime|date='Y-m-d H:i:s',###}</span></li>
                    </ul>
                </div>
                <div class="standard p">
                    <ul>
                       <li class="jaj ls4"><span>结束时间 ： </span></li>
                       <li><span style="color: #e23435">{$goods.endtime|date='Y-m-d H:i:s',###}</span></li>
                    </ul>
                </div>
                <div class="standard p">
                    <ul>
                        <li class="jaj ls4"><span>交货期 ： </span></li>
                        <li><span style="color: #e23435">{$goods.givetime}</span></li>
                    </ul>
                </div>
                <div class="standard p">
                    <ul>
                        <li class="jaj ls4"><span>供应商 ： </span></li>
                        <li><span>{$goods.supply}</span></li>
                    </ul>
                </div>
                <div class="standard p">
                    <ul>
                        <li class="jaj ls4"><span>地址 ： </span></li>
                        <li><span>{$goods.address}</span></li>
                    </ul>
                </div>
                <div class="standard p">
                    <ul>
                        <li class="jaj ls4"><span>商品描述 ： </span></li>
                        <li><span>{$goods.desc}</span></li>
                    </ul>
                </div>
                <notempty name="$goods['brand']">
                    <div class="standard p">
                        <ul>
                            <li class="jaj"><span>品&nbsp;&nbsp;牌：</span></li>
                            <li class="lawir"><span class="service">{$goods['brand']['name']}</span></li>
                        </ul>
                    </div>
                </notempty>

                <!-- 规格 start [[-->
                <foreach name="filter_spec" item="v" key="k">
                    <div class="spec_goods_price_div standard p">
                        <ul>
                            <li class="jaj"><span>{$k}：</span></li>
                            <li class="lawir colo">
                                <foreach name="v" item="v2" key="k2">
                                    <input type="radio" hidden id="goods_spec_{$v2[item_id]}" name="goods_spec[{$k}]" value="{$v2[item_id]}"/>
                                    <a id="goods_spec_a_{$v2[item_id]}" class="spec_item">
                                        <if condition="$v2[src] neq ''">
                                            <img src="{$v2[src]}" style="width: 40px;height: 40px;"/>
                                            <span class="dis_alintro">{$v2[item]}</span>
                                            <else/>
                                            {$v2[item]}
                                        </if>
                                    </a>
                                </foreach>
                            </li>
                        </ul>
                    </div>
                </foreach>
                <script>

                </script>
                <!-- 规格end ]]-->
                <div class="standard">
                    <ul class="p">
                        <li class="jaj"><span>数&nbsp;&nbsp;量：</span></li>
                        <li class="lawir">
                            <div class="minus-plus">
                                <input class="buyNum" id="number" type="text" name="num" value="{$goods.num}" readonly="readonly"
                                    style="width: 100px;" />                           
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="standard p">
                    <div class="standard p">
                        <if condition="time() gt $goods.endtime"> 
                            <a class="addcar buy_button" href="javascript:;">拍卖已结束</a>&nbsp;&nbsp;&nbsp;
                        <elseif condition="time() egt $goods.starttime and time() elt $goods.endtime">
                            <if condition="$cash.state eq 1">
                                <a class="addcar buy_button baozheng" href="javascript:;">已交保证金</a>&nbsp;&nbsp;&nbsp;
                            <else/>    
                                <a id="jiao" class="addcar buy_button baozheng" href="javascript:;">交保证金</a>&nbsp;&nbsp;&nbsp;
                            </if>
                            <a id="pai" class="paybybill buy_button" href="javascript:;" style="display: none;">拍卖</a>
                            <a id="pais" class="paybybill buy_button" href="javascript:;" style="display: none;">拍卖已结束</a>
                       <else/> 
                            <a class="addcar buy_button" href="javascript:;">拍卖未开始</a>&nbsp;&nbsp;&nbsp;
                        </if>
                    </div>
                </div>
            </div>
        </form>
        <!--看了又看-s-->
        <div class="detail-ry p">
            <div class="type_more">
                <div class="type-top">
                    <h2>看了又看<a class="update_h fr" href="javascript:;" onclick="replace_look();">换一换</a></h2>
                </div>
                <div id="see_and_see">
                </div>
            </div>
        </div>
        <!--看了又看-s-->
    </div>
</div>
<!--搭配购组合套餐 s-->
<include file="sale/goodsInfoCombination"/>
<!--搭配购组合套餐 e-->
<div class="detail-main p">
    <div class="w1224">
        <div class="deta-le-ma">
            <div class="type_more">
                <div class="type-top">
                    <h2>热搜推荐</h2>
                </div>
                <div class="type-bot">
                    <ul class="xg_typ">
                        <foreach name="tpshop_config.hot_keywords" item="wd" key="k">
                            <li><a href="{:U('Home/sale/search',array('q'=>$wd))}">{$wd}</a></li>
                        </foreach>
                    </ul>
                </div>
            </div>
            <div class="type_more ma-to-20">
                <div class="type-top">
                    <h2>推荐热卖</h2>
                </div>
                <div class="tjhot-shoplist type-bot">
                    <tpshop sql="select id,sname,shop_price from `__PREFIX__sale` where is_hot=1 and is_on_sale = 1 limit 10"
                            item="vo" key="k">
                        <div class="alone-shop">
                            <a href="{:U('Home/sale/goodsInfo',array('id'=>$vo[id]))}"><img
                                    src="{$vo.id|sale_thum_images=206,206}" style="display: inline;"></a>
                            <p class="line-two-hidd"><a href="{:U('Home/sale/goodsInfo',array('id'=>$vo[id]))}">{$vo.sname|getSubstr=0,30}</a>
                            </p>
                            <p class="price-tag"><span class="li_xfo">￥</span><span>{$vo.shop_price}</span></p>
                            <!--<p class="store-alone"><a href="">恒要达食品专享店</a></p>-->
                        </div>
                    </tpshop>
                </div>
            </div>
        </div>
        <include file="sale/goodsInfoDetail"/>
    </div>
</div>
<script type="text/javascript">
    //	商品详情页 滚动到一定位置固定定位
    $(window).scroll(function () {
        if ($(window).scrollTop() <= 850) {
            $("#datail-nav-top").css("position", "static");
        } else {
            $("#datail-nav-top").css({
                "position": "fixed",
                "top": "0",
                "left": "600",
                "width": "968",
                "z-index": "10007",
                "background-color": "#fff"
            });
        }
    });

</script>
<!--footer-s-->
<include file="public/footer"/>
<include file="public/sidebar_cart"/>
<!--看了又看-s-->
<div style="display: none" id="look_see">
    <foreach name="look_see" item="look" key="k">
        <div class="tjhot-shoplist type-bot">
            <div class="alone-shop">
                <a href="{:U('Home/sale/goodsInfo',array('id'=>$look[id]))}">
                    <img class="wiahides"src="{$look.id|sale_thum_images=206,206}" style="display: inline;"></a>
                <p class="shop_name2">
                    <a href="{:U('Home/sale/goodsInfo',array('id'=>$look[id]))}">{$look.sname}</a>
                </p>
                <p class="price-tag">
                    <span class="li_xfo">￥</span><span>{$look.shop_price}</span>
                </p>
            </div>
        </div>
    </foreach>
    <!--看了又看-s-->
</div>
<!--footer-e-->
<script src="__STATIC__/js/lazyload.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="__STATIC__/js/headerfooter.js"></script>
</body>
</html>
<script type="text/javascript">
    //一秒刷新一次开奖
/*    setInterval(function () { 
       var url ="{:U('Home/sale/goodsInfo',array('id'=>$goods.id))}";
       $("#now_prices").load(url+"#now_price");
    }, 2000);*/
    //判断是否有视频标签
    if ($('#video').length > 0) {
        $('#photoBody').addClass('videoshow-ac');
    }
    //点击关闭视频
    $('.video-play').click(function (event) {
        $('#photoBody').addClass('videoshow-ac').removeClass('picshow-ac');
        video.play();
    });
    //点击播放视频
    $('.close-video').click(function (event) {
        $('#photoBody').addClass('picshow-ac').removeClass('videoshow-ac');
        video.pause();
    });

    $(document).ready(function () {
        /*商品缩略图放大镜*/
        $(".jqzoom").jqueryzoom({
            xzoom: 500,
            yzoom: 500,
            offset: 1,
            position: "right",
            preload: 1,
            lens: 1
        });
        replace_look();
        changeImg();
    });
    //看了又看切换
    var tmpindex = 0;
    var look_see_length = $('#look_see').children().length;
    function replace_look() {
        var listr = '';
        if (tmpindex * 2 >= look_see_length) tmpindex = 0;
        $('#look_see').children().each(function (i, o) {
            if ((i >= tmpindex * 2) && (i < (tmpindex + 1) * 2)) {
                listr += '<div class="tjhot-shoplist type-bot">' + $(o).html() + '</div>';
            }
        });
        tmpindex++;
        $('#see_and_see').empty().append(listr);
    }

    //缩略图切换
    function changeImg() {
        var $picBox = $('#small-pic');
        var $picList = $picBox.find('.small-pic-li');
        var length = $picList.length;
        $picBox.css('width', 70 * length);
        if ($('#video').length > 0) { //判断是否有视频标签
            $('#photoBody').addClass('videoshow-ac');
        }
        $('.video-play').click(function (event) { //点击关闭视频
            $('#photoBody').addClass('videoshow-ac').removeClass('picshow-ac');
            video.play();
        });
        $('.close-video').click(function (event) {  //点击播放视频
            $('#photoBody').addClass('picshow-ac').removeClass('videoshow-ac');
            video.pause();
        });
        //缩略图切换
        $picList.mouseenter(function () {
            if ($('#video').length > 0) {
                $('.close-video').trigger('click');
            }
            $(this).addClass('active').siblings().removeClass('active');
            $('#zoomimg').attr('src', $(this).find('img').attr('data-img')).attr('jqimg', $(this).find('img').attr('data-big'));
        })
        var i = 0;
        if (length <= 5) {
            $('.product-gallery .next-btn').css('display', 'none');
        } else {
            //前一张缩略图
            $('.next-left').click(function () {
                i--;
                if (i < 0) {
                    i = 0;
                    return;
                }
                $picBox.animate({left: -i * 70}, 500);
            })
            //后前一张缩略图
            $('.next-right').click(function () {
                i++;
                if (i > length - 5) {
                    i = length - 5;
                    return;
                }
                $picBox.animate({left: -i * 70}, 500);
            })
        }
    }

   var starttime = parseInt($("input[name='starttime']").attr('value'));
   var endtimes = parseInt($("input[name='endtime']").attr('value'));
   var time = <?php echo time();?>;
   if(time >= starttime && time<= endtimes){
        $('.presale-time').show();
        $('#pai').show();
        setInterval(activityTime, 1000);
   }

    // 倒计时
    function activityTime() {
        var endtime = parseInt($("input[name='endtime']").attr('value'));
        var timestamp = Date.parse(new Date());
        var now = timestamp / 1000;
        var endtime_date = formatDate(endtime * 1000);
        var text = GetRTime(endtime_date);
        //活动时间到了就刷新页面重新载入
        if (now > endtime) {
            var goods_id = $('#goods_id').val();
            $.ajax({
                type: "POST",
                url: "{:U('home/sale/goodsid')}",
                dataType: "json",
                data:{goods_id:goods_id},
                error: function () {
                    layer.alert("请求失败!");
                },
                success: function (data) {
                    if (data.status == 1) {
                        layer.msg(data.msg, function () {
                            location.reload();
                        });
                    }
                }
            });
        }
        $("#overTime").text(text);
    }
    
    //时间戳转换
    function add0(m) {
        return m < 10 ? '0' + m : m
    }

    //时间戳转换字符
    function formatDate(now) {
        var time = new Date(now);
        var y = time.getFullYear();
        var m = time.getMonth() + 1;
        var d = time.getDate();
        var h = time.getHours();
        var mm = time.getMinutes();
        var s = time.getSeconds();
        return y + '/' + add0(m) + '/' + add0(d) + ' ' + add0(h) + ':' + add0(mm) + ':' + add0(s);
    }

    $("#jiao").click(function(){
       var goods_id = $('#goods_id').val();
       var market_price = $('#market_price').html();
       var uid = $("#uid").val();
       if(uid == ""){
            location.href = "{:U('Home/user/login')}";
            return false;
       }
       //询问框
        layer.confirm('您确定要交保证金？', {
          btn: ['确定','取消'] //按钮
        }, function(){
           $.ajax({
            type: "POST",
            url: "{:U('home/saleorder/cash')}",
            dataType: "json",
            data:{goods_id:goods_id,money:market_price},
            error: function () {
                layer.alert("请求失败!");
            },
            success: function (data) {
                console.log(data);
                if (data.status == 1) {
                    layer.msg(data.msg,{icon: 1,time: 2000},function(){
                        location.reload();
                    });
                } else {
                    layer.msg(data.msg,{icon: 2,time: 2000},function(){
                       location.href = data.url;
                    });
                }
            }
          });
        }, function(){
        });
    })

    $("#pai").click(function(){
        var uid = $("#uid").val();
        if(uid == ""){
            location.href = "{:U('Home/user/login')}";
            return false;
        }
        var states = $("#states").val();
        if(states != 1){
            layer.alert('你还未交保证金', {icon: 2,time: 3000});
            return false;
        } 

        layui.use('layer', function(){
            var layer = layui.layer;
            layer.prompt({
            offset: 'auto',  
            title:'请输入拍卖金额,进行金牌',
            resize : true,
            btn: ['确定', '取消']
            ,yes: function(index){
                var money = $(".layui-layer-input").val();
                var reg= /^(-?\d+)(\.\d{1,2})?$/;
                if(money < 0  ||  !reg.test(money)){
                    layer.msg('金额不能小于0，不能超过2位小数',{icon: 2,time: 2000});
                    return false;
                }

            var goods_id = $('#goods_id').val();
            $.ajax({
                type: "POST",
                url: "{:U('home/saleorder/orders')}",
                dataType: "json",
                data:{goods_id:goods_id,money:money},
                error: function () {
                    layer.alert("请求失败!");
                },
                success: function (data) {
                    if (data.status == 1) {
                        layer.msg(data.msg,{icon: 1,time: 2000},function(){
                            location.reload();
                        });
                    } else {
                        layer.msg(data.msg, {icon: 2,time: 2000});
                    }
                }
            });
                layer.close(index);
            }
            });
        }); 
    })

</script>